module.exports = function ($scope, $modal, $modalInstance, $resource, item, enterpriseType) {

	$scope.obj = item;

	var para = {
		'enterpriseType': enterpriseType,
		'enterpriseCode': item.enterprise_code
	};

	//通过
	$scope.pass = function (){
		if (confirm('确认企业审核已通过？')==true){
			para.pass = '0';
			$resource('/api/ac/dsc/checkEnterpriseService/setCheckResult', {}, {}).save(para, function(res){
				if(res.errcode === 0){
					$modalInstance.close();
				}else{
					alert(res.errmsg);
				}
			});
		}
	};

	//驳回
	$scope.reject = function (){
		para.pass = '1';
		var modalInstance = $modal.open({
			template: require('../views/enterprise_nopass.html'),
			controller: 'enterpriseNopass',
			size: 'lg',
			resolve: {
				para: function () {
					return para;
				},
				no_pass: function () {
					return true;
				}
			}
		});
		modalInstance.result.then(function() {
			$modalInstance.close();
		});

	};

	//关闭
	$scope.cancel = function (){
		$modalInstance.dismiss('cancel');
	};


};